package com.diyunapp.xilinapp.me;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.diyunapp.xilinapp.R;
import com.diyunapp.xilinapp.selfdefine.StatusBarFragmentActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class RechargeActivity extends StatusBarFragmentActivity {
//充值
    @Bind(R.id.recharge_record_tv)
    TextView rechargeRecordTv;
    @Bind(R.id.rel_topbar)
    RelativeLayout relTopbar;
    @Bind(R.id.account_money)
    TextView accountMoney;
    @Bind(R.id.recharge_money_et)
    EditText rechargeMoneyEt;
    @Bind(R.id.alipay_choice)
    RelativeLayout alipayChoice;
    @Bind(R.id.sure_to_recharge)
    TextView sureToRecharge;
    @Bind(R.id.go_back)
    ImageView goBack;
    private String member_id;
    private String username;
    private String accountMoney1;
    private static final int SDK_PAY_FLAG = 1;
    private int paytypeflag = 1;
    private String orderInfo;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recharge);
        ButterKnife.bind(this);
        View headView;
        headView = findViewById(R.id.recharg_menu);
        super.MenuWidget(headView);
        SharedPreferences userinfo=getSharedPreferences("user_info",MODE_PRIVATE);
        member_id=userinfo.getString("member_id","");
        username=userinfo.getString("username","");
        accountMoney1=getIntent().getExtras().getString("accountMoney");
        accountMoney.setText(accountMoney1);
//        getRecharge(member_id);
    }
    @OnClick({R.id.recharge_record_tv, R.id.go_back, R.id.sure_to_recharge, R.id.alipay_choice})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.recharge_record_tv:

                nextAct(RechargeRecordActivity.class);
                break;
            case R.id.go_back:
//                nextAct(SumMoneyActivity.class);
                finish();
                break;
            case R.id.sure_to_recharge:
                Intent intent2 = new Intent();
                intent2.setClass(this, ChargePayCommitActivity.class);
                intent2.putExtra("account", rechargeMoneyEt.getText().toString().trim());
                startActivity(intent2);
                finish();
                break;
        }
    }
    public void nextAct(Class act){
        Intent intent = new Intent();
        intent.setClass(this, act);
        startActivity(intent);
    }
}
